﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VicMessenger.DB;
using VicMessenger.DAL;

namespace VicMessenger.BLL
{
    class CategoryBLL
    {
        public static List<proc_Category_SelectResult> GetAllCategory()
        {
            try
            {
                return CategoryDAL.GetCategory(null);
            }
            catch (Exception)
            {

                return null;
            }
        }

        public static proc_Category_SelectResult GetCategoryByID(int prmCategoryID)
        {
            try
            {
                return CategoryDAL.GetCategory(prmCategoryID)[0]; 
            }
            catch (Exception)
            {

                return null;
            }
        }

        public static int? InsertUpdateCategory(proc_Category_SelectResult prmCategory)
        {
            try
            {
                return CategoryDAL.InsertUpdateCategory(prmCategory);
            }
            catch (Exception)
            {

                return 0;
            }
        }

        public static int? DeleteCategory(int prmCategoryID)
        {
            try
            {
                return CategoryDAL.DeleteCategory(prmCategoryID);
            }
            catch (Exception)
            {

                return 0;
            }
        }
    }
}
